package com.utooo.controller;


import com.utooo.constant.ResultCodeConstant;
import com.utooo.pojo.dto.common.CreateGroup;
import com.utooo.pojo.dto.common.RestResult;
import com.utooo.pojo.dto.supplier.purchase.PurchaseContractRenewDto;
import com.utooo.service.supplier.SupplierPurchaseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 供应商门户-合同续签控制层
 * @Author SJD
 * @Date: 2025/4/29 13:38
 * @Copyright: 南京优通信息科技股份有限公司
 */
@Tag(name = "采购管理")
@RequestMapping("/supplier")
@RestController
@RequiredArgsConstructor
public class SupplierPurchaseController {

    private final SupplierPurchaseService purchaseExecutionServiceImpl;
    @RequestMapping(value = "/pushPurchaseContractRenew", method = RequestMethod.POST)
    @Operation(summary = "供货方推送合同续签至采购方")
    @ResponseBody
    public RestResult<Boolean> pushPurchaseContractRenew(@RequestBody @Validated(CreateGroup.class) PurchaseContractRenewDto param) {
        Boolean result = purchaseExecutionServiceImpl.pushPurchaseContractRenew(param);
        return new RestResult<>(ResultCodeConstant.CODE_200, ResultCodeConstant.CODE_200_MSG, result);
    }
}
